package com.macro.mall.common.utils;

import java.util.Date;

public class DateUtils {
    /**
     * Date转时间戳(毫秒)
     */
    public static Long dateToTimestamp(Date date) {
        return date != null ? date.getTime() : null;
    }

    /**
     * 时间戳(毫秒)转Date
     */
    public static Date timestampToDate(Long timestamp) {
        return timestamp != null ? new Date(timestamp) : null;
    }
}
